/*
 * @Author: zu1662
 * @LastEditor: zu1662
 * @Date: 2019-12-16 16:16:13
 * @LastEditTime: 2021-06-17 17:42:55
 * @Description: i18n init
 */
import Vue from 'vue'
import VueI18n from 'vue-i18n'
// default language
import enLocale from './lang/en'
import zhLocale from './lang/zh'
// element locale lang
import elementEnLocale from 'element-ui/lib/locale/lang/en'
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'

Vue.use(VueI18n)

export const defaultLang = 'zh'

const messages = {
  en: {
    ...elementEnLocale,
    ...enLocale
  },
  zh: {
    ...elementZhLocale,
    ...zhLocale
  }
}

const i18n = new VueI18n({
  locale: defaultLang,
  fallbackLocale: defaultLang,
  messages
})

export default i18n
